home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Sep 90 / MacApp.Tech$ 9⁄14⁄90 / 1963-Re [de]Activate Timi-Sep90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  4.2 KB  |  101 lines  |  [TEXT/GEOL]

  1. Item    6065592                         11-Sept-90        20:52PDT
  2.  
  3. From:   SATORI                          Satori SW, Hugh Rogovy,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    re:[de]Activate Timing (long)
  8.  
  9.  
  10. Tommi & Gerhard, thanks *A LOT* for sharing your findings regarding the slow
  11. [de]activates in complicated views.  Your suggestions were both fine, but we
  12. decided instead to make a wholesale modification to MacApp.  After taking a
  13. look at the section of MacApp you pointed out, I've decided that the *real*
  14. culprit isn't just the view tree walking through the Activate method.  What's
  15. happening is that every single view in a window is taking a hit just to see if
  16. it would be OK to call DoHilightSelection.  The only TView subclass in MacApp
  17. that even uses DoHilightSelection is TGridView.  This isn't alone all that
  18. horrible because walking straight *down* the view tree and calling an empty
  19. method doesn't really take all that much time (even with 2000 views).  The
  20. sickening thing in TView.Activate, is the line:
  21.  
  22.     IF Focus & IsVisible THEN
  23.  
  24. Both of the above methods can cause ANOTHER walk *UP* the view tree performing
  25. unneeded Boolean evaluations and region manipulations.  On top of that, I
  26. didn't think a view could be focused unless it was visible (unless my version
  27. of MacApp has been modified beyond recognition…), which means that the order of
  28. evaluation is wrong in the IF statement.  Also, once I do hit a view in which
  29. (Focus & IsVisible)=FALSE then none of the subviews can possible evaluate to
  30. (Focus & IsVisible)=TRUE (but they're checked again anyway!!).  That's a pretty
  31. ridiculous way to make sure that TGridViews get their selections during an
  32. activate.
  33.  
  34. Our way of getting around this is more of a kludge that anything else, but
  35. nobody can say it's worse than what was already there.  We have modified TView
  36. to contain a new instance variable called fWantHilighting which we default to
  37. FALSE all non-hilightable views and check during TView.Activate as shown below.
  38. Another (probably more correct) solution might be to call DoHighlightSelection
  39. from a TGridView.Activate OVERRIDE method rather than from TView.Activate.
  40. There's probably an even better solution...
  41.  
  42.  
  43. ***SOAPBOX TIME***
  44. Ok, it's well past mealtime (both lunch & dinner), I'm irritable and this will
  45. most likely be the only time you'll hear me talk this way about MacApp (unless
  46. you visit my office), so bear with me as I go off into tirade-land for a
  47. moment...
  48.  
  49.     I wouldn't be so irritated by the TView.Activate problem if I hadn't been
  50. through so many other time-consuming (ie. $-consuming) problems with the
  51. release version of MA 2.0! I don't need to be specific, we all know what I'm
  52. talking about. I'm really tired of defending myself to my superiors because of
  53. something that someone else destroyed in our perfectly working app.  I have to
  54. wonder if they'll ever trust my judgement again regarding development
  55. environments (yes, I'm the bonehead who convinced them that MacApp would make
  56. life easier).  It's still probably true that MacApp saved us time, but another
  57. few dozen pages of bug fixes may change my mind really fast.  MacApp
  58. team...please...please write yourselves a more complete set of test
  59. applications.  At least 80% of the bugs that have surfaced in MacApp have shown
  60. up in at least one of the applications we're using it for. I'm not saying that
  61. we found them first - just that they were there and fairly obvious.  It is
  62. inexcusable that they make it out Cupertino...
  63.  
  64. whew...I feel a tiny bit better...and I do still look forward to MacApp being a
  65. way of life for our development team...after it stabilizes a little...really...
  66.  
  67.  
  68. Chris Le Croy
  69. Satori Software
  70.  
  71.  
  72. Tommi & Gerhard, thanks again...
  73.  
  74. ****************************************************************
  75. PROCEDURE TView.Activate(entering: BOOLEAN);
  76.  
  77.    VAR
  78.    newHL:  HLState;
  79.  
  80.    PROCEDURE ActivateSubView(theSubView: TView);
  81.  
  82.    BEGIN
  83.    theSubView.Activate(entering);
  84.    END;
  85.  
  86.    BEGIN
  87.    IF fWantHilighting THEN
  88.    BEGIN
  89.    IF entering THEN
  90.    newHL := hlOn
  91.    ELSE
  92.    newHL := hlDim;
  93.    IF Focus & IsVisible THEN
  94.    DoHighlightSelection(fHLDesired, newHL);
  95.    fHLDesired := newHL;
  96.    END;
  97.    EachSubView(ActivateSubView);
  98.    END;
  99.  
  100.  
  101.